<template>
  <form @submit="formSubmit">
    <div class='depotEnterDetail'>
      <scroll-view scroll-y>
        <detailList type='到店交付'></detailList>
        <div class="detailList">
            <div class="weui-cells__title header">高管审核</div>
          <div class="weui-cells weui-cells_after-title">
            <div class="weui-cell">
              <div class="weui-cell__bd">图片</div>
              <div class="weui-cell__ft">
                <Qinniu  :disabled="editCode" :data="imagesArray"></Qinniu>
              </div>
            </div>

             <div class="weui-cell">
              <div class="weui-cell__bd">备注</div>
              <div class="weui-cell__ft">
                <input maxlength="100" :disabled="editCode"  name="beizhu" :value="data.beizhu" placeholder="填写备注" />
              </div>
            </div>

          </div>
        </div>
        <view class="btn-area submit">
          <button formType="submit">提交</button>
        </view>
      </scroll-view>
    </div>
  </form>
</template>

<script>
  import Qinniu from '@/components/common/Qinniu'
  import searchTriangle from "@/components/common/searchTriangle"
  import detailList from '@/components/common/detailList'
  export default {
    data() {
      return {
        data:{
          beizhu:"",
        },
        imagesArray:[],
        editCode: true, //编辑，还会查看，亦或者是添加
      }
    },
    methods: {
      is_disabled() {
        let code = this.$mp.query.idCode
        switch (true) {
          case code == 1: //编辑
            this.editCode = false;
            break;
          case code == 2: //查看
            this.editCode = true;
            break;
          default:
            this.editCode = false;
            break; //添加
        }
      },

      formSubmit: function (e) {
        const params = e.mp.detail.value;
    
        this.$https.post("http://rap2api.taobao.org/app/mock/22254/lyl/xiaochegnxu/Warehousing_button_post", {params,img:this.imagesArray}).then(res => {
            wx.showModal({
               content: "提交成功",
              showCancel: false,
            })
        })
      },
    },
     mounted() {
      this.is_disabled();
      this.$https.get("http://rap2api.taobao.org/app/mock/22254/lyl/xiaochengxu/WarehousingDetail", {
        id: this.$mp.query.id
      }).then(res => {
          this.data = Object.assign({},this.data,res.data.data);
          this.imagesArray = res.data.data.imgLIst;
      })
    },
    components: {
      Qinniu,searchTriangle,detailList
    }
  }
</script>


<style lang="scss" scoped>
  .depotEnterDetail {
    height: 100%;
    box-sizing: border-box;
    scroll-view {
      height: 100%;
    
    }

  
    
  }
</style>
